package threadtest;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author shentianyu
 * @date 2021-06-29 12:12
 */
public class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 1; i <= 10; i++) {
            System.out.println(Thread.currentThread().getName()+" 执行 "+i+" times");
        }
    }
}

class ThreadDemo{
    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        MyThread myThread1 = new MyThread();
        MyThread myThread2 = new MyThread();
        MyThread myThread3 = new MyThread();
        myThread.start();
        myThread1.start();
        myThread2.start();
        myThread3.start();


    }
}
